Infopath People Picker AutoPopulate User's Data
Hi All,
I have a infopath form which auto populates users info through "GetuserProfileByName" data connection.
I have a people picker control on the form, this is for submitting request on behalf of some other user. Once we select the user all the fields(auto populated ) should change to the selected users info.
I have added a button and applied rules that if peopel picker is not empty run the action Query for data and used "GetuserProfileByName" data connection and then Set a fields value to the users info.
This seems to be not working. Can someone tell me where i am going wrong?
-
Edited by
Sree99
Tuesday, February 05, 2013 10:32 PM
February 5th, 2013 10:02pm
You'll notice that the People Picker has three values that need data set.
I set the DisplayName to be the "PreferredName" returned from the User Profile Service, the AccountID to be the "AccountName from the User Profile Service, and the AccountType will always be "User"

February 6th, 2013 5:44am
Hi Roland,
I am not getting the "Action" option in the rule its disabled. Only Formatting is enabled in the dropdown.
February 6th, 2013 7:18pm
You can't apply actions on a people picker. You'll need to apply rules on another field.
February 7th, 2013 1:43am
Hi Roland,
This approach doesn't work, the connection is not working. Its not loading data in the fields. I need to overwrite the data in the fields which is auto populated when the user opens the form.
February 11th, 2013 5:08pm
If I understand you correctly, you have a people picker control. If that value is changed, you want to query the user profile service and bring back data on the selected user, correct?
If that's the case, you're going to need to add another field, since you can't have rules on the people picker control.
Add another field with a default value of AccountID from the people picker control. Assign rules to that field so that if the value changes, set the query value of the GetUserProfileByName data connection. Then query the data connection. Then set your fields.
February 12th, 2013 5:07am
Hi Roland,
That worked thank you. I have added a button and applied rules to it. When i preview it, on one click i am able to see the data in the fields. But when i publish to SharePoint site i need to double click the button to populate the fields. Any suggestions???
February 12th, 2013 4:03pm
Maybe I'm missing something. Why do you have a button? I thought you wanted to query info on a user if the value of a People Picker changes.
February 14th, 2013 4:04am
Hello,
I'm trying to follow this. If I set what you have listed in your screen capture above on the new text field, doesn't this create an infinite loop since setting the value of AccountID then causes this field to change as it is the default value for this field?
Also, along these same lines, I'm trying to take the value that is returned in the people picker, strip the domain portion from the ID, and compare it against a Sharepoint list of UserIDs that do not contain the domain. If the UserID is in this list
I need to add prefix 'A' to the ID and use that complete ID as the AccountID. If the ID is not in the Sharepoint list then I need to use prefix 'B' and use that complete ID as the AccountID. I thought I had it, but the field is no longer resolving as
it was. Any assistance would be helpful.
Thanks,
Jason
November 22nd, 2013 6:26pm
Hi Roland,
Same Issue i was facing.
above step is working for me perfectly.
Nice answer.
April 14th, 2015 3:03am